import { request } from '@/api/service'
import util from "@/libs/util";

export const urlPrefix = '/api/dvadmin_third/'

export function ScanLoginUrl (query) {
  query.base_url = util.baseURL()
  // 判断，如果是斜杠开头，需要把域名添加上
  if (query.base_url[0] === '/'){
    query.base_url = location.protocol + '//' + location.hostname + (location.port ? ':' : '') + location.port + query.base_url
  }
  return request({
    url: urlPrefix + 'login/scan_login_url/',
    method: 'get',
    params: query
  })
}
export function VerifyWhetherScan (data) {
  return request({
    url: urlPrefix + 'login/verify_whether_scan/',
    method: 'post',
    data: data
  })
}
